<template>
  <el-button
    type="warning"
    @click="exportData"
  >导出</el-button></template>

<script>
  export default {
    name: 'Export',
    methods: {
      exportData() {
        console.log('call export', this.$parent.listQuery, this.$parent.getList, this.$parent.doSearch)
        if (this.$parent.listQuery) {
          this.$parent.listQuery.export_excel = 1
        }
        if (this.$parent.getList) {
          this.$parent.getList()
        } else if (this.$parent.doSearch) {
          this.$parent.doSearch()
        }
        // this.$parent.listQuery.export_excel = 0
        const that = this
        this.$nextTick(() => {
          that.$nextTick(() => {
            delete that.$parent.listQuery.export_excel
          })
        })
      }
    }
  }
</script>

<style scoped>

</style>
